home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1993-03-04 | 7.9 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Thu Mar 4 02:17:10 1993, modified Thu Mar 4 02:17:10 1993, creator Think C, type ASCII, 7125 bytes "MakeNoise.c" , at 0x1c55 680 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 4d 61 6b 65 4e 6f | 69 73 65 2e 63 00 00 00 |..MakeNo|ise.c...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 1b d5 00 | 00 02 a8 a7 bb 5d 76 a7 |........|.....]v.|
|00000060| bb 5d 76 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.]v.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 3b 5c 00 00 |........|....;\..|
|00000080| 2f 2a 20 4d 61 6b 65 4e | 6f 69 73 65 2e 63 0d a9 |/* MakeN|oise.c..|
|00000090| 20 31 39 38 39 2d 31 39 | 39 32 20 44 65 6e 69 73 | 1989-19|92 Denis|
|000000a0| 20 47 2e 20 50 65 6c 6c | 69 2e 0d 4d 61 6b 65 4e | G. Pell|i..MakeN|
|000000b0| 6f 69 73 65 31 28 29 20 | 66 69 6c 6c 73 20 61 20 |oise1() |fills a |
|000000c0| 50 69 78 4d 61 70 20 77 | 69 74 68 20 6e 6f 69 73 |PixMap w|ith nois|
|000000d0| 65 2e 20 54 68 65 20 6e | 6f 69 73 65 20 69 73 20 |e. The n|oise is |
|000000e0| 6d 61 64 65 20 75 70 20 | 6f 66 20 62 6c 61 63 6b |made up |of black|
|000000f0| 20 26 20 77 68 69 74 65 | 20 63 65 6c 6c 73 2c 0d | & white| cells,.|
|00000100| 65 61 63 68 20 64 78 20 | 70 69 78 65 6c 73 20 77 |each dx |pixels w|
|00000110| 69 64 65 20 62 79 20 64 | 79 20 70 69 78 65 6c 73 |ide by d|y pixels|
|00000120| 20 68 69 67 68 2e 20 52 | 61 6e 64 6f 6d 20 70 68 | high. R|andom ph|
|00000130| 61 73 65 20 69 73 20 6f | 70 74 69 6f 6e 61 6c 2e |ase is o|ptional.|
|00000140| 0d 0d 49 66 20 79 6f 75 | 72 20 50 69 78 4d 61 70 |..If you|r PixMap|
|00000150| 20 62 61 73 65 41 64 64 | 72 3d 3d 4e 55 4c 4c 20 | baseAdd|r==NULL |
|00000160| 74 68 65 6e 20 74 68 65 | 20 64 61 74 61 20 61 72 |then the| data ar|
|00000170| 65 61 20 77 69 6c 6c 20 | 62 65 20 61 6c 6c 6f 63 |ea will |be alloc|
|00000180| 61 74 65 64 20 66 6f 72 | 20 79 6f 75 2e 0d 49 6e |ated for| you..In|
|00000190| 20 74 68 61 74 20 63 61 | 73 65 20 79 6f 75 20 6d | that ca|se you m|
|000001a0| 75 73 74 20 73 65 74 20 | 66 72 61 6d 65 2e 62 6f |ust set |frame.bo|
|000001b0| 75 6e 64 73 20 61 6e 64 | 20 66 72 61 6d 65 2e 70 |unds and| frame.p|
|000001c0| 69 78 65 6c 53 69 7a 65 | 2e 20 45 76 65 72 79 74 |ixelSize|. Everyt|
|000001d0| 68 69 6e 67 20 65 6c 73 | 65 20 77 69 6c 6c 20 62 |hing els|e will b|
|000001e0| 65 0d 66 69 6c 6c 65 64 | 20 69 6e 20 62 79 20 4d |e.filled| in by M|
|000001f0| 61 6b 65 4e 6f 69 73 65 | 31 2e 20 49 74 20 77 69 |akeNoise|1. It wi|
|00000200| 6c 6c 20 69 6e 73 74 61 | 6c 6c 20 61 20 68 61 6e |ll insta|ll a han|
|00000210| 64 6c 65 20 74 6f 20 74 | 68 65 20 63 75 72 72 65 |dle to t|he curre|
|00000220| 6e 74 20 64 65 76 69 63 | 65 27 73 20 63 6f 6c 6f |nt devic|e's colo|
|00000230| 72 20 74 61 62 6c 65 2e | 0d 54 68 65 20 76 61 6c |r table.|.The val|
|00000240| 75 65 73 20 66 69 6c 6c | 65 64 20 69 6e 74 6f 20 |ues fill|ed into |
|00000250| 74 68 65 20 66 69 65 6c | 64 73 20 61 72 65 20 6e |the fiel|ds are n|
|00000260| 65 63 65 73 73 61 72 69 | 6c 79 20 73 6f 6d 65 77 |ecessari|ly somew|
|00000270| 68 61 74 20 61 72 62 69 | 74 72 61 72 79 2e 20 46 |hat arbi|trary. F|
|00000280| 6f 72 20 6d 6f 72 65 0d | 63 6f 6e 74 72 6f 6c 2c |or more.|control,|
|00000290| 20 66 69 6c 6c 20 69 6e | 20 74 68 65 20 66 69 65 | fill in| the fie|
|000002a0| 6c 64 73 20 79 6f 75 72 | 73 65 6c 66 2c 20 75 73 |lds your|self, us|
|000002b0| 69 6e 67 20 4e 65 77 50 | 69 78 4d 61 70 28 29 2c |ing NewP|ixMap(),|
|000002c0| 20 61 6e 64 20 61 6c 6c | 6f 63 61 74 65 20 74 68 | and all|ocate th|
|000002d0| 65 20 64 61 74 61 20 61 | 72 65 61 0d 79 6f 75 72 |e data a|rea.your|
|000002e0| 73 65 6c 66 20 62 65 66 | 6f 72 65 20 63 61 6c 6c |self bef|ore call|
|000002f0| 69 6e 67 20 4d 61 6b 65 | 4e 6f 69 73 65 31 2e 0d |ing Make|Noise1..|
|00000300| 0d 49 20 73 75 67 67 65 | 73 74 20 74 68 61 74 20 |.I sugge|st that |
|00000310| 6e 65 77 20 70 72 6f 67 | 72 61 6d 73 20 75 73 65 |new prog|rams use|
|00000320| 20 4d 61 6b 65 4e 6f 69 | 73 65 31 28 29 2e 20 54 | MakeNoi|se1(). T|
|00000330| 68 65 20 6f 6c 64 20 4d | 61 6b 65 4e 6f 69 73 65 |he old M|akeNoise|
|00000340| 28 29 20 69 73 20 72 65 | 74 61 69 6e 65 64 0d 6f |() is re|tained.o|
|00000350| 6e 6c 79 20 66 6f 72 20 | 74 68 65 20 73 61 6b 65 |nly for |the sake|
|00000360| 20 6f 66 20 6f 6c 64 20 | 70 72 6f 67 72 61 6d 73 | of old |programs|
|00000370| 2e 0d 0d 4d 61 6b 65 4e | 6f 69 73 65 28 29 20 66 |...MakeN|oise() f|
|00000380| 69 6c 6c 73 20 61 6e 20 | 61 72 72 61 79 20 6f 66 |ills an |array of|
|00000390| 20 50 69 78 4d 61 70 73 | 20 77 69 74 68 20 6e 6f | PixMaps| with no|
|000003a0| 69 73 65 2c 20 62 79 20 | 63 61 6c 6c 69 6e 67 20 |ise, by |calling |
|000003b0| 4d 61 6b 65 4e 6f 69 73 | 65 31 28 29 0d 72 65 70 |MakeNois|e1().rep|
|000003c0| 65 61 74 65 64 6c 79 2e | 20 48 6f 77 65 76 65 72 |eatedly.| However|
|000003d0| 2c 20 69 74 20 66 69 72 | 73 74 20 73 65 74 73 20 |, it fir|st sets |
|000003e0| 74 68 65 20 62 61 73 65 | 41 64 64 72 20 74 6f 20 |the base|Addr to |
|000003f0| 7a 65 72 6f 2c 20 73 6f | 20 65 61 63 68 20 64 61 |zero, so| each da|
|00000400| 74 61 20 61 72 65 61 0d | 77 69 6c 6c 20 61 6c 77 |ta area.|will alw|
|00000410| 61 79 73 20 62 65 20 61 | 6c 6c 6f 63 61 74 65 64 |ays be a|llocated|
|00000420| 2c 20 66 6f 72 20 63 6f | 6d 70 61 74 69 62 69 6c |, for co|mpatibil|
|00000430| 69 74 79 20 77 69 74 68 | 20 6f 6c 64 20 70 72 6f |ity with| old pro|
|00000440| 67 72 61 6d 73 2e 20 0d | 59 6f 75 20 6d 75 73 74 |grams. .|You must|
|00000450| 20 73 65 74 20 6d 6f 76 | 69 65 5b 30 5d 2e 62 6f | set mov|ie[0].bo|
|00000460| 75 6e 64 73 20 61 6e 64 | 20 6d 6f 76 69 65 5b 30 |unds and| movie[0|
|00000470| 5d 2e 70 69 78 65 6c 53 | 69 7a 65 20 74 6f 20 74 |].pixelS|ize to t|
|00000480| 68 65 20 64 65 73 69 72 | 65 64 20 76 61 6c 75 65 |he desir|ed value|
|00000490| 73 2c 0d 74 68 65 20 72 | 65 73 74 20 6f 66 20 74 |s,.the r|est of t|
|000004a0| 68 65 20 70 61 72 61 6d | 65 74 65 72 73 20 28 61 |he param|eters (a|
|000004b0| 6e 64 20 61 6c 6c 20 74 | 68 65 20 72 65 73 74 20 |nd all t|he rest |
|000004c0| 6f 66 20 74 68 65 20 50 | 69 78 4d 61 70 73 29 20 |of the P|ixMaps) |
|000004d0| 77 69 6c 6c 20 62 65 20 | 73 65 74 20 75 70 20 66 |will be |set up f|
|000004e0| 6f 72 20 79 6f 75 2e 0d | 49 66 20 6d 65 6d 6f 72 |or you..|If memor|
|000004f0| 79 20 72 75 6e 73 20 6f | 75 74 20 62 65 66 6f 72 |y runs o|ut befor|
|00000500| 65 20 61 6c 6c 20 74 68 | 65 20 50 69 78 4d 61 70 |e all th|e PixMap|
|00000510| 20 64 61 74 61 20 61 72 | 65 61 73 20 61 72 65 20 | data ar|eas are |
|00000520| 61 6c 6c 6f 63 61 74 65 | 64 20 74 68 65 6e 0d 2a |allocate|d then.*|
|00000530| 6d 61 78 46 72 61 6d 65 | 73 50 74 72 20 69 73 20 |maxFrame|sPtr is |
|00000540| 72 65 64 75 63 65 64 20 | 61 63 63 6f 72 64 69 6e |reduced |accordin|
|00000550| 67 6c 79 2e 0d 0d 4d 61 | 6b 65 4e 6f 69 73 65 31 |gly...Ma|keNoise1|
|00000560| 20 75 73 65 73 20 74 68 | 65 20 63 75 72 72 65 6e | uses th|e curren|
|00000570| 74 20 46 6f 72 65 43 6f | 6c 6f 72 20 61 6e 64 20 |t ForeCo|lor and |
|00000580| 42 61 63 6b 43 6f 6c 6f | 72 20 74 6f 20 6d 61 6b |BackColo|r to mak|
|00000590| 65 20 74 68 65 20 6e 6f | 69 73 65 2c 20 73 6f 0d |e the no|ise, so.|
|000005a0| 6d 61 6b 65 20 73 75 72 | 65 20 79 6f 75 27 76 65 |make sur|e you've|
|000005b0| 20 73 65 74 20 74 68 65 | 20 70 6f 72 74 20 74 6f | set the| port to|
|000005c0| 20 73 6f 6d 65 74 68 69 | 6e 67 20 61 70 70 72 6f | somethi|ng appro|
|000005d0| 70 72 69 61 74 65 2e 20 | 28 41 6e 64 2c 20 69 66 |priate. |(And, if|
|000005e0| 20 62 61 73 65 41 64 64 | 72 3d 3d 4e 55 4c 4c 2c | baseAdd|r==NULL,|
|000005f0| 0d 69 74 20 73 68 61 72 | 65 73 20 74 68 65 20 63 |.it shar|es the c|
|00000600| 6f 6c 6f 72 20 74 61 62 | 6c 65 20 6f 66 20 74 68 |olor tab|le of th|
|00000610| 65 20 63 75 72 72 65 6e | 74 20 64 65 76 69 63 65 |e curren|t device|
|00000620| 2c 20 73 6f 20 74 68 65 | 20 64 65 76 69 63 65 20 |, so the| device |
|00000630| 73 68 6f 75 6c 64 20 62 | 65 20 0d 72 65 61 73 6f |should b|e .reaso|
|00000640| 6e 61 62 6c 65 20 74 6f | 6f 2e 29 20 41 70 70 6c |nable to|o.) Appl|
|00000650| 65 27 73 20 47 65 74 47 | 57 6f 72 6c 64 20 61 6e |e's GetG|World an|
|00000660| 64 20 53 65 74 47 57 6f | 72 6c 64 20 63 61 6c 6c |d SetGWo|rld call|
|00000670| 73 20 61 72 65 20 61 20 | 63 6f 6e 76 65 6e 69 65 |s are a |convenie|
|00000680| 6e 74 20 77 61 79 20 6f | 66 0d 67 65 74 74 69 6e |nt way o|f.gettin|
|00000690| 67 2c 20 63 68 61 6e 67 | 69 6e 67 2c 20 61 6e 64 |g, chang|ing, and|
|000006a0| 20 72 65 73 74 6f 72 69 | 6e 67 20 74 68 65 20 70 | restori|ng the p|
|000006b0| 6f 72 74 20 61 6e 64 20 | 64 65 76 69 63 65 2e 0d |ort and |device..|
|000006c0| 0d 48 49 53 54 4f 52 59 | 3a 0d 36 2f 32 31 2f 38 |.HISTORY|:.6/21/8|
|000006d0| 39 20 64 67 70 09 63 68 | 61 6e 67 65 64 20 66 72 |9 dgp.ch|anged fr|
|000006e0| 61 6d 65 42 79 74 65 73 | 20 61 6e 64 20 62 75 66 |ameBytes| and buf|
|000006f0| 66 65 72 42 79 74 65 73 | 20 74 6f 20 6c 6f 6e 67 |ferBytes| to long|
|00000700| 20 73 6f 20 74 68 61 74 | 20 74 68 69 73 20 63 6f | so that| this co|
|00000710| 64 65 20 77 6f 6e 27 74 | 20 63 72 61 73 68 0d 09 |de won't| crash..|
|00000720| 09 09 69 66 20 74 68 65 | 20 70 69 78 65 6c 53 69 |..if the| pixelSi|
|00000730| 7a 65 20 69 73 20 67 72 | 65 61 74 65 72 20 74 68 |ze is gr|eater th|
|00000740| 61 6e 20 31 20 62 69 74 | 2e 0d 38 2f 35 2f 38 39 |an 1 bit|..8/5/89|
|00000750| 20 64 67 70 09 77 72 6f | 74 65 20 61 6e 64 20 69 | dgp.wro|te and i|
|00000760| 6e 73 74 61 6c 6c 65 64 | 20 72 61 6e 64 55 28 29 |nstalled| randU()|
|00000770| 2c 20 77 68 69 63 68 20 | 79 69 65 6c 64 73 20 74 |, which |yields t|
|00000780| 77 6f 20 72 61 6e 64 6f | 6d 20 62 79 74 65 73 20 |wo rando|m bytes |
|00000790| 70 65 72 20 63 61 6c 6c | 2c 20 69 6e 73 74 65 61 |per call|, instea|
|000007a0| 64 0d 09 09 09 6f 66 20 | 72 61 6e 64 28 29 20 77 |d....of |rand() w|
|000007b0| 68 69 63 68 20 79 69 65 | 6c 64 73 20 6f 6e 6c 79 |hich yie|lds only|
|000007c0| 20 6f 6e 65 2c 20 61 6c | 6c 6f 77 69 6e 67 20 74 | one, al|lowing t|
|000007d0| 68 65 20 6e 6f 69 73 65 | 20 67 65 6e 65 72 61 74 |he noise| generat|
|000007e0| 69 6f 6e 20 74 6f 20 67 | 6f 20 74 77 69 63 65 0d |ion to g|o twice.|
|000007f0| 09 09 09 61 73 20 66 61 | 73 74 2e 0d 33 2f 31 31 |...as fa|st..3/11|
|00000800| 2f 39 30 20 64 67 70 09 | 43 68 61 6e 67 65 64 20 |/90 dgp.|Changed |
|00000810| 64 78 20 61 6e 64 20 64 | 79 20 66 72 6f 6d 20 69 |dx and d|y from i|
|00000820| 6e 74 20 74 6f 20 64 6f | 75 62 6c 65 2e 20 54 68 |nt to do|uble. Th|
|00000830| 69 73 20 61 6c 6c 6f 77 | 73 20 6e 6f 6e 75 6e 69 |is allow|s nonuni|
|00000840| 66 6f 72 6d 20 63 65 6c | 6c 20 73 69 7a 65 2c 0d |form cel|l size,.|
|00000850| 09 09 09 77 68 69 63 68 | 20 61 72 69 73 65 73 20 |...which| arises |
|00000860| 77 68 65 6e 20 43 6f 70 | 79 42 69 74 73 20 65 78 |when Cop|yBits ex|
|00000870| 70 61 6e 64 73 20 62 79 | 20 74 68 65 73 65 20 6e |pands by| these n|
|00000880| 6f 6e 69 6e 74 65 67 72 | 61 6c 20 66 61 63 74 6f |onintegr|al facto|
|00000890| 72 73 2e 20 52 65 73 75 | 6c 74 73 0d 09 09 09 77 |rs. Resu|lts....w|
|000008a0| 69 6c 6c 20 62 65 20 73 | 61 6d 65 20 61 73 20 62 |ill be s|ame as b|
|000008b0| 65 66 6f 72 65 20 77 68 | 65 6e 20 69 6e 74 65 67 |efore wh|en integ|
|000008c0| 72 61 6c 20 76 61 6c 75 | 65 73 20 61 72 65 20 73 |ral valu|es are s|
|000008d0| 75 70 70 6c 69 65 64 2e | 0d 09 09 09 4d 61 64 65 |upplied.|....Made|
|000008e0| 20 74 68 65 20 63 6f 73 | 6d 65 74 69 63 20 63 68 | the cos|metic ch|
|000008f0| 61 6e 67 65 20 6f 66 20 | 72 65 70 6c 61 63 69 6e |ange of |replacin|
|00000900| 67 20 22 75 6e 73 69 67 | 6e 65 64 20 6c 6f 6e 67 |g "unsig|ned long|
|00000910| 22 20 62 79 20 22 73 69 | 7a 65 5f 74 22 2e 0d 33 |" by "si|ze_t"..3|
|00000920| 2f 32 30 2f 39 30 09 64 | 67 70 09 6d 61 6b 65 20 |/20/90.d|gp.make |
|00000930| 63 6f 6d 70 61 74 69 62 | 6c 65 20 77 69 74 68 20 |compatib|le with |
|00000940| 4d 50 57 20 43 2e 0d 33 | 2f 33 31 2f 39 30 09 64 |MPW C..3|/31/90.d|
|00000950| 67 70 09 73 65 74 20 70 | 6d 56 65 72 73 69 6f 6e |gp.set p|mVersion|
|00000960| 20 74 6f 20 7a 65 72 6f | 20 66 6f 72 20 63 6f 6d | to zero| for com|
|00000970| 70 61 74 69 62 69 6c 69 | 74 79 20 77 69 74 68 20 |patibili|ty with |
|00000980| 51 44 33 32 0d 38 2f 37 | 2f 39 30 09 64 67 70 09 |QD32.8/7|/90.dgp.|
|00000990| 4e 6f 77 20 75 73 65 73 | 20 74 68 65 20 63 75 72 |Now uses| the cur|
|000009a0| 72 65 6e 74 20 46 6f 72 | 65 43 6f 6c 6f 72 20 61 |rent For|eColor a|
|000009b0| 6e 64 20 42 61 63 6b 43 | 6f 6c 6f 72 20 74 6f 20 |nd BackC|olor to |
|000009c0| 6d 61 6b 65 20 74 68 65 | 20 6e 6f 69 73 65 2e 0d |make the| noise..|
|000009d0| 09 09 09 46 6f 72 20 66 | 75 74 75 72 65 20 63 6f |...For f|uture co|
|000009e0| 6d 70 61 74 69 62 69 6c | 69 74 79 2c 20 6e 6f 77 |mpatibil|ity, now|
|000009f0| 20 7a 65 72 6f 65 73 20 | 74 68 65 20 70 61 63 6b | zeroes |the pack|
|00000a00| 54 79 70 65 2c 20 65 74 | 63 2e 20 66 69 65 6c 64 |Type, et|c. field|
|00000a10| 73 2e 0d 31 30 2f 31 2f | 39 30 09 64 67 70 09 43 |s..10/1/|90.dgp.C|
|00000a20| 6f 73 6d 65 74 69 63 20 | 63 68 61 6e 67 65 73 3a |osmetic |changes:|
|00000a30| 20 72 65 70 6c 61 63 65 | 64 20 74 77 6f 20 4f 66 | replace|d two Of|
|00000a40| 66 73 65 74 52 65 63 74 | 20 63 61 6c 6c 73 20 62 |fsetRect| calls b|
|00000a50| 79 20 43 65 6e 74 65 72 | 52 65 63 74 49 6e 52 65 |y Center|RectInRe|
|00000a60| 63 74 20 63 61 6c 6c 2e | 0d 31 31 2f 31 36 2f 39 |ct call.|.11/16/9|
|00000a70| 30 20 64 67 70 20 41 64 | 64 65 64 20 52 41 4e 44 |0 dgp Ad|ded RAND|
|00000a80| 4f 4d 5f 50 48 41 53 45 | 2e 0d 34 2f 32 30 2f 39 |OM_PHASE|..4/20/9|
|00000a90| 31 09 64 67 70 09 41 64 | 64 65 64 20 6e 65 77 20 |1.dgp.Ad|ded new |
|00000aa0| 4d 61 6b 65 4e 6f 69 73 | 65 31 28 29 20 74 68 61 |MakeNois|e1() tha|
|00000ab0| 74 20 61 63 63 65 70 74 | 73 20 61 20 73 69 6e 67 |t accept|s a sing|
|00000ac0| 6c 65 20 50 69 78 4d 61 | 70 2c 20 61 6e 64 20 61 |le PixMa|p, and a|
|00000ad0| 6c 6c 6f 63 61 74 65 73 | 0d 09 09 09 69 74 73 20 |llocates|....its |
|00000ae0| 64 61 74 61 20 61 72 65 | 61 20 6f 6e 6c 79 20 69 |data are|a only i|
|00000af0| 66 20 62 61 73 65 41 64 | 64 72 3d 3d 4e 55 4c 4c |f baseAd|dr==NULL|
|00000b00| 2c 20 6f 74 68 65 72 77 | 69 73 65 20 61 73 73 75 |, otherw|ise assu|
|00000b10| 6d 69 6e 67 20 74 68 61 | 74 20 69 74 20 61 6c 72 |ming tha|t it alr|
|00000b20| 65 61 64 79 0d 09 09 09 | 65 78 69 73 74 73 2e 20 |eady....|exists. |
|00000b30| 49 20 72 65 77 72 6f 74 | 65 20 4d 61 6b 65 4e 6f |I rewrot|e MakeNo|
|00000b40| 69 73 65 28 29 20 74 6f | 20 73 69 6d 70 6c 79 20 |ise() to| simply |
|00000b50| 63 61 6c 6c 20 4d 61 6b | 65 4e 6f 69 73 65 31 28 |call Mak|eNoise1(|
|00000b60| 29 20 72 65 70 65 61 74 | 65 64 6c 79 2e 0d 09 09 |) repeat|edly....|
|00000b70| 09 4d 61 6b 65 4e 6f 69 | 73 65 28 29 20 6e 6f 77 |.MakeNoi|se() now|
|00000b80| 20 73 65 65 6d 73 20 6f | 62 73 6f 6c 65 74 65 2c | seems o|bsolete,|
|00000b90| 20 62 75 74 20 69 73 20 | 72 65 74 61 69 6e 65 64 | but is |retained|
|00000ba0| 20 66 6f 72 20 63 6f 6d | 70 61 74 69 62 69 6c 69 | for com|patibili|
|00000bb0| 74 79 20 77 69 74 68 20 | 6f 6c 64 0d 09 09 09 70 |ty with |old....p|
|00000bc0| 72 6f 67 72 61 6d 73 2e | 0d 34 2f 32 34 2f 39 31 |rograms.|.4/24/91|
|00000bd0| 09 64 67 70 09 46 69 78 | 65 64 20 62 75 67 20 69 |.dgp.Fix|ed bug i|
|00000be0| 6e 74 72 6f 64 75 63 65 | 64 20 69 6e 74 6f 20 4d |ntroduce|d into M|
|00000bf0| 61 6b 65 4e 6f 69 73 65 | 28 29 20 6f 6e 20 34 2f |akeNoise|() on 4/|
|00000c00| 32 30 2c 20 77 68 69 63 | 68 20 72 65 73 75 6c 74 |20, whic|h result|
|00000c10| 65 64 20 69 6e 20 61 6c | 6c 20 74 68 65 0d 09 09 |ed in al|l the...|
|00000c20| 09 50 69 78 4d 61 70 73 | 20 75 73 69 6e 67 20 74 |.PixMaps| using t|
|00000c30| 68 65 20 73 61 6d 65 20 | 62 75 66 66 65 72 2e 0d |he same |buffer..|
|00000c40| 38 2f 36 2f 39 31 09 64 | 67 70 09 52 65 70 6c 61 |8/6/91.d|gp.Repla|
|00000c50| 63 65 64 20 75 73 65 20 | 6f 66 20 72 61 6e 64 55 |ced use |of randU|
|00000c60| 28 29 20 62 79 20 52 61 | 6e 64 46 69 6c 6c 28 29 |() by Ra|ndFill()|
|00000c70| 2c 20 77 68 69 63 68 20 | 69 73 20 74 77 69 63 65 |, which |is twice|
|00000c80| 20 61 73 20 66 61 73 74 | 2e 0d 38 2f 32 34 2f 39 | as fast|..8/24/9|
|00000c90| 31 09 64 67 70 09 4d 61 | 64 65 20 63 6f 6d 70 61 |1.dgp.Ma|de compa|
|00000ca0| 74 69 62 6c 65 20 77 69 | 74 68 20 54 48 49 4e 4b |tible wi|th THINK|
|00000cb0| 20 43 20 35 2e 30 2e 0d | 34 2f 31 37 2f 39 32 09 | C 5.0..|4/17/92.|
|00000cc0| 64 67 70 09 52 65 6d 6f | 76 65 64 20 68 69 64 64 |dgp.Remo|ved hidd|
|00000cd0| 65 6e 20 61 73 73 75 6d | 70 74 69 6f 6e 20 74 68 |en assum|ption th|
|00000ce0| 61 74 20 66 72 61 6d 65 | 2d 3e 62 6f 75 6e 64 73 |at frame|->bounds|
|00000cf0| 2e 74 6f 70 20 61 6e 64 | 20 66 72 61 6d 65 2d 3e |.top and| frame->|
|00000d00| 62 6f 75 6e 64 73 2e 6c | 65 66 74 0d 09 09 09 77 |bounds.l|eft....w|
|00000d10| 65 72 65 20 62 6f 74 68 | 20 7a 65 72 6f 2e 20 49 |ere both| zero. I|
|00000d20| 66 20 74 68 65 79 20 77 | 65 72 65 20 6e 65 67 61 |f they w|ere nega|
|00000d30| 74 69 76 65 20 4d 61 6b | 65 4e 6f 69 73 65 31 20 |tive Mak|eNoise1 |
|00000d40| 77 6f 75 6c 64 20 61 6c | 6c 6f 63 61 74 65 20 74 |would al|locate t|
|00000d50| 6f 6f 20 0d 09 09 09 6c | 69 74 74 6c 65 20 73 70 |oo ....l|ittle sp|
|00000d60| 61 63 65 2c 20 61 6e 64 | 20 74 68 65 6e 20 6f 76 |ace, and| then ov|
|00000d70| 65 72 77 72 69 74 65 20 | 6d 65 6d 6f 72 79 20 61 |erwrite |memory a|
|00000d80| 6e 64 20 63 72 61 73 68 | 2e 0d 34 2f 32 37 2f 39 |nd crash|..4/27/9|
|00000d90| 32 09 64 67 70 09 49 6e | 69 74 69 61 6c 69 7a 65 |2.dgp.In|itialize|
|00000da0| 20 61 6c 6c 20 72 65 6d | 61 69 6e 69 6e 67 20 66 | all rem|aining f|
|00000db0| 69 65 6c 64 73 20 6f 66 | 20 74 68 65 20 66 72 61 |ields of| the fra|
|00000dc0| 6d 65 20 50 69 78 4d 61 | 70 2c 20 61 6e 64 20 63 |me PixMa|p, and c|
|00000dd0| 6f 70 79 20 74 68 65 20 | 63 75 72 72 65 6e 74 0d |opy the |current.|
|00000de0| 09 09 09 64 65 76 69 63 | 65 27 73 20 63 6f 6c 6f |...devic|e's colo|
|00000df0| 72 20 74 61 62 6c 65 20 | 68 61 6e 64 6c 65 2e 0d |r table |handle..|
|00000e00| 31 30 2f 32 32 2f 39 32 | 20 64 67 70 20 43 68 65 |10/22/92| dgp Che|
|00000e10| 63 6b 20 66 6f 72 20 65 | 72 72 6f 72 20 69 6e 20 |ck for e|rror in |
|00000e20| 43 6f 70 79 42 69 74 73 | 2e 0d 2a 2f 0d 23 69 6e |CopyBits|..*/.#in|
|00000e30| 63 6c 75 64 65 20 22 56 | 69 64 65 6f 54 6f 6f 6c |clude "V|ideoTool|
|00000e40| 62 6f 78 2e 68 22 0d 23 | 69 6e 63 6c 75 64 65 20 |box.h".#|include |
|00000e50| 3c 6d 61 74 68 2e 68 3e | 0d 0d 76 6f 69 64 20 4d |<math.h>|..void M|
|00000e60| 61 6b 65 4e 6f 69 73 65 | 28 64 6f 75 62 6c 65 20 |akeNoise|(double |
|00000e70| 64 78 2c 64 6f 75 62 6c | 65 20 64 79 2c 50 69 78 |dx,doubl|e dy,Pix|
|00000e80| 4d 61 70 20 6d 6f 76 69 | 65 5b 5d 2c 73 68 6f 72 |Map movi|e[],shor|
|00000e90| 74 20 2a 6d 61 78 46 72 | 61 6d 65 73 50 74 72 29 |t *maxFr|amesPtr)|
|00000ea0| 0d 7b 0d 09 69 6e 74 20 | 69 2c 65 72 72 6f 72 3b |.{..int |i,error;|
|00000eb0| 0d 09 42 6f 6f 6c 65 61 | 6e 20 72 61 6e 64 6f 6d |..Boolea|n random|
|00000ec0| 50 68 61 73 65 3d 31 3b | 0d 0d 09 2f 2a 0d 09 41 |Phase=1;|.../*..A|
|00000ed0| 6c 77 61 79 73 20 61 6c | 6c 6f 63 61 74 65 20 65 |lways al|locate e|
|00000ee0| 61 63 68 20 66 72 61 6d | 65 27 73 20 64 61 74 61 |ach fram|e's data|
|00000ef0| 20 61 72 65 61 2e 0d 09 | 54 68 69 73 20 69 73 20 | area...|This is |
|00000f00| 61 6e 20 6f 6c 64 20 64 | 65 63 69 73 69 6f 6e 2c |an old d|ecision,|
|00000f10| 20 77 68 69 63 68 20 73 | 65 65 6d 73 20 73 69 6c | which s|eems sil|
|00000f20| 6c 79 20 6e 6f 77 2c 20 | 62 75 74 20 74 6f 6f 20 |ly now, |but too |
|00000f30| 6d 61 6e 79 20 70 72 6f | 67 72 61 6d 73 0d 09 77 |many pro|grams..w|
|00000f40| 6f 75 6c 64 20 62 72 65 | 61 6b 20 69 66 20 49 20 |ould bre|ak if I |
|00000f50| 63 68 61 6e 67 65 64 20 | 69 74 2c 20 73 6f 20 69 |changed |it, so i|
|00000f60| 74 20 73 74 61 79 73 2e | 0d 09 2a 2f 0d 09 66 6f |t stays.|..*/..fo|
|00000f70| 72 20 28 69 3d 30 3b 69 | 3c 2a 6d 61 78 46 72 61 |r (i=0;i|<*maxFra|
|00000f80| 6d 65 73 50 74 72 3b 69 | 2b 2b 29 7b 0d 09 09 6d |mesPtr;i|++){...m|
|00000f90| 6f 76 69 65 5b 69 5d 3d | 6d 6f 76 69 65 5b 30 5d |ovie[i]=|movie[0]|
|00000fa0| 3b 0d 09 09 6d 6f 76 69 | 65 5b 69 5d 2e 62 61 73 |;...movi|e[i].bas|
|00000fb0| 65 41 64 64 72 3d 4e 55 | 4c 4c 3b 0d 09 09 65 72 |eAddr=NU|LL;...er|
|00000fc0| 72 6f 72 3d 4d 61 6b 65 | 4e 6f 69 73 65 31 28 64 |ror=Make|Noise1(d|
|00000fd0| 78 2c 64 79 2c 72 61 6e | 64 6f 6d 50 68 61 73 65 |x,dy,ran|domPhase|
|00000fe0| 2c 26 6d 6f 76 69 65 5b | 69 5d 29 3b 0d 09 09 69 |,&movie[|i]);...i|
|00000ff0| 66 28 65 72 72 6f 72 29 | 62 72 65 61 6b 3b 0d 09 |f(error)|break;..|
|00001000| 7d 0d 09 2a 6d 61 78 46 | 72 61 6d 65 73 50 74 72 |}..*maxF|ramesPtr|
|00001010| 3d 69 3b 0d 7d 0d 0d 42 | 6f 6f 6c 65 61 6e 20 4d |=i;.}..B|oolean M|
|00001020| 61 6b 65 4e 6f 69 73 65 | 31 28 64 6f 75 62 6c 65 |akeNoise|1(double|
|00001030| 20 64 78 2c 64 6f 75 62 | 6c 65 20 64 79 2c 42 6f | dx,doub|le dy,Bo|
|00001040| 6f 6c 65 61 6e 20 72 61 | 6e 64 6f 6d 50 68 61 73 |olean ra|ndomPhas|
|00001050| 65 2c 50 69 78 4d 61 70 | 20 2a 66 72 61 6d 65 29 |e,PixMap| *frame)|
|00001060| 0d 7b 0d 09 42 69 74 4d | 61 70 20 62 75 66 66 65 |.{..BitM|ap buffe|
|00001070| 72 2c 62 69 67 42 75 66 | 66 65 72 3b 0d 09 52 65 |r,bigBuf|fer;..Re|
|00001080| 63 74 20 73 72 63 52 65 | 63 74 3b 0d 09 73 69 7a |ct srcRe|ct;..siz|
|00001090| 65 5f 74 20 66 72 61 6d | 65 42 79 74 65 73 2c 62 |e_t fram|eBytes,b|
|000010a0| 75 66 66 65 72 42 79 74 | 65 73 3b 0d 09 52 47 42 |ufferByt|es;..RGB|
|000010b0| 43 6f 6c 6f 72 20 62 6c | 61 63 6b 52 47 42 3d 7b |Color bl|ackRGB={|
|000010c0| 30 2c 30 2c 30 7d 2c 77 | 68 69 74 65 52 47 42 3d |0,0,0},w|hiteRGB=|
|000010d0| 7b 30 78 66 66 66 66 2c | 30 78 66 66 66 66 2c 30 |{0xffff,|0xffff,0|
|000010e0| 78 66 66 66 66 7d 2c 62 | 61 63 6b 52 47 42 2c 66 |xffff},b|ackRGB,f|
|000010f0| 6f 72 65 52 47 42 3b 0d | 09 50 69 78 4d 61 70 20 |oreRGB;.|.PixMap |
|00001100| 2a 2a 70 6d 3b 0d 09 4f | 53 45 72 72 20 65 72 72 |**pm;..O|SErr err|
|00001110| 6f 72 3b 0d 09 0d 09 47 | 65 74 42 61 63 6b 43 6f |or;....G|etBackCo|
|00001120| 6c 6f 72 28 26 62 61 63 | 6b 52 47 42 29 3b 0d 09 |lor(&bac|kRGB);..|
|00001130| 47 65 74 46 6f 72 65 43 | 6f 6c 6f 72 28 26 66 6f |GetForeC|olor(&fo|
|00001140| 72 65 52 47 42 29 3b 0d | 09 0d 09 73 72 61 6e 64 |reRGB);.|...srand|
|00001150| 55 28 28 75 6e 73 69 67 | 6e 65 64 20 69 6e 74 29 |U((unsig|ned int)|
|00001160| 72 61 6e 64 28 29 29 3b | 09 2f 2a 20 73 65 65 64 |rand());|./* seed|
|00001170| 20 6d 79 20 75 6e 73 69 | 67 6e 65 64 20 72 61 6e | my unsi|gned ran|
|00001180| 64 6f 6d 20 6e 75 6d 62 | 65 72 20 67 65 6e 65 72 |dom numb|er gener|
|00001190| 61 74 6f 72 20 2a 2f 0d | 0d 09 2f 2a 20 61 6c 6c |ator */.|../* all|
|000011a0| 6f 63 61 74 65 20 62 75 | 66 66 65 72 20 42 69 74 |ocate bu|ffer Bit|
|000011b0| 4d 61 70 20 2a 2f 0d 09 | 53 65 74 52 65 63 74 28 |Map */..|SetRect(|
|000011c0| 26 62 75 66 66 65 72 2e | 62 6f 75 6e 64 73 2c 30 |&buffer.|bounds,0|
|000011d0| 2c 30 2c 31 2b 28 69 6e | 74 29 63 65 69 6c 28 28 |,0,1+(in|t)ceil((|
|000011e0| 66 72 61 6d 65 2d 3e 62 | 6f 75 6e 64 73 2e 72 69 |frame->b|ounds.ri|
|000011f0| 67 68 74 2d 66 72 61 6d | 65 2d 3e 62 6f 75 6e 64 |ght-fram|e->bound|
|00001200| 73 2e 6c 65 66 74 29 2f | 64 78 29 2c 0d 09 09 31 |s.left)/|dx),...1|
|00001210| 2b 28 69 6e 74 29 63 65 | 69 6c 28 28 66 72 61 6d |+(int)ce|il((fram|
|00001220| 65 2d 3e 62 6f 75 6e 64 | 73 2e 62 6f 74 74 6f 6d |e->bound|s.bottom|
|00001230| 2d 66 72 61 6d 65 2d 3e | 62 6f 75 6e 64 73 2e 74 |-frame->|bounds.t|
|00001240| 6f 70 29 2f 64 79 29 29 | 3b 0d 09 62 75 66 66 65 |op)/dy))|;..buffe|
|00001250| 72 2e 72 6f 77 42 79 74 | 65 73 3d 28 62 75 66 66 |r.rowByt|es=(buff|
|00001260| 65 72 2e 62 6f 75 6e 64 | 73 2e 72 69 67 68 74 20 |er.bound|s.right |
|00001270| 2b 20 33 31 20 26 20 7e | 33 31 29 2f 38 3b 20 2f |+ 31 & ~|31)/8; /|
|00001280| 2a 20 72 6f 75 6e 64 20 | 75 70 20 74 6f 20 6d 75 |* round |up to mu|
|00001290| 6c 74 69 70 6c 65 20 6f | 66 20 33 32 20 62 69 74 |ltiple o|f 32 bit|
|000012a0| 73 20 2a 2f 0d 09 62 75 | 66 66 65 72 42 79 74 65 |s */..bu|fferByte|
|000012b0| 73 3d 28 73 69 7a 65 5f | 74 29 20 62 75 66 66 65 |s=(size_|t) buffe|
|000012c0| 72 2e 72 6f 77 42 79 74 | 65 73 20 2a 20 28 73 69 |r.rowByt|es * (si|
|000012d0| 7a 65 5f 74 29 20 62 75 | 66 66 65 72 2e 62 6f 75 |ze_t) bu|ffer.bou|
|000012e0| 6e 64 73 2e 62 6f 74 74 | 6f 6d 3b 0d 09 62 75 66 |nds.bott|om;..buf|
|000012f0| 66 65 72 2e 62 61 73 65 | 41 64 64 72 3d 28 50 74 |fer.base|Addr=(Pt|
|00001300| 72 29 20 4e 65 77 50 74 | 72 28 62 75 66 66 65 72 |r) NewPt|r(buffer|
|00001310| 42 79 74 65 73 29 3b 0d | 09 69 66 28 62 75 66 66 |Bytes);.|.if(buff|
|00001320| 65 72 2e 62 61 73 65 41 | 64 64 72 20 3d 3d 20 4e |er.baseA|ddr == N|
|00001330| 55 4c 4c 29 0d 09 09 50 | 72 69 6e 74 66 45 78 69 |ULL)...P|rintfExi|
|00001340| 74 28 22 5c 30 30 37 4d | 61 6b 65 4e 6f 69 73 65 |t("\007M|akeNoise|
|00001350| 31 3a 20 73 6f 72 72 79 | 2c 20 6e 6f 74 20 65 6e |1: sorry|, not en|
|00001360| 6f 75 67 68 20 6d 65 6d | 6f 72 79 20 66 6f 72 20 |ough mem|ory for |
|00001370| 62 75 66 66 65 72 2e 5c | 6e 22 29 3b 0d 0d 09 2f |buffer.\|n");.../|
|00001380| 2a 20 61 6c 6c 6f 63 61 | 74 65 20 62 69 67 42 75 |* alloca|te bigBu|
|00001390| 66 66 65 72 20 42 69 74 | 4d 61 70 20 2a 2f 0d 09 |ffer Bit|Map */..|
|000013a0| 53 65 74 52 65 63 74 20 | 28 26 62 69 67 42 75 66 |SetRect |(&bigBuf|
|000013b0| 66 65 72 2e 62 6f 75 6e | 64 73 2c 30 2c 30 2c 28 |fer.boun|ds,0,0,(|
|000013c0| 69 6e 74 29 66 6c 6f 6f | 72 28 62 75 66 66 65 72 |int)floo|r(buffer|
|000013d0| 2e 62 6f 75 6e 64 73 2e | 72 69 67 68 74 2a 64 78 |.bounds.|right*dx|
|000013e0| 2b 30 2e 35 29 2c 0d 09 | 09 28 69 6e 74 29 66 6c |+0.5),..|.(int)fl|
|000013f0| 6f 6f 72 28 62 75 66 66 | 65 72 2e 62 6f 75 6e 64 |oor(buff|er.bound|
|00001400| 73 2e 62 6f 74 74 6f 6d | 2a 64 79 2b 30 2e 35 29 |s.bottom|*dy+0.5)|
|00001410| 29 3b 0d 09 62 69 67 42 | 75 66 66 65 72 2e 72 6f |);..bigB|uffer.ro|
|00001420| 77 42 79 74 65 73 3d 28 | 62 69 67 42 75 66 66 65 |wBytes=(|bigBuffe|
|00001430| 72 2e 62 6f 75 6e 64 73 | 2e 72 69 67 68 74 20 2b |r.bounds|.right +|
|00001440| 20 33 31 20 26 20 7e 33 | 31 29 2f 38 3b 20 2f 2a | 31 & ~3|1)/8; /*|
|00001450| 20 72 6f 75 6e 64 20 75 | 70 20 74 6f 20 6d 75 6c | round u|p to mul|
|00001460| 74 69 70 6c 65 20 6f 66 | 20 33 32 20 62 69 74 73 |tiple of| 32 bits|
|00001470| 20 2a 2f 0d 09 62 69 67 | 42 75 66 66 65 72 2e 62 | */..big|Buffer.b|
|00001480| 61 73 65 41 64 64 72 3d | 28 50 74 72 29 20 4e 65 |aseAddr=|(Ptr) Ne|
|00001490| 77 50 74 72 28 28 73 69 | 7a 65 5f 74 29 20 62 69 |wPtr((si|ze_t) bi|
|000014a0| 67 42 75 66 66 65 72 2e | 72 6f 77 42 79 74 65 73 |gBuffer.|rowBytes|
|000014b0| 20 2a 20 28 73 69 7a 65 | 5f 74 29 20 62 69 67 42 | * (size|_t) bigB|
|000014c0| 75 66 66 65 72 2e 62 6f | 75 6e 64 73 2e 62 6f 74 |uffer.bo|unds.bot|
|000014d0| 74 6f 6d 29 3b 0d 09 69 | 66 28 62 69 67 42 75 66 |tom);..i|f(bigBuf|
|000014e0| 66 65 72 2e 62 61 73 65 | 41 64 64 72 20 3d 3d 20 |fer.base|Addr == |
|000014f0| 4e 55 4c 4c 29 7b 0d 09 | 09 50 72 69 6e 74 66 45 |NULL){..|.PrintfE|
|00001500| 78 69 74 28 22 5c 30 30 | 37 4d 61 6b 65 4e 6f 69 |xit("\00|7MakeNoi|
|00001510| 73 65 31 3a 20 73 6f 72 | 72 79 2c 20 6e 6f 74 20 |se1: sor|ry, not |
|00001520| 65 6e 6f 75 67 68 20 6d | 65 6d 6f 72 79 20 66 6f |enough m|emory fo|
|00001530| 72 20 62 69 67 42 75 66 | 66 65 72 2e 5c 6e 22 29 |r bigBuf|fer.\n")|
|00001540| 3b 0d 09 7d 0d 0d 09 2f | 2a 20 69 66 20 6e 65 63 |;..}.../|* if nec|
|00001550| 65 73 73 61 72 79 2c 20 | 66 69 6c 6c 20 69 6e 20 |essary, |fill in |
|00001560| 66 72 61 6d 65 27 73 20 | 66 69 65 6c 64 73 20 61 |frame's |fields a|
|00001570| 6e 64 20 61 6c 6c 6f 63 | 61 74 65 20 69 74 73 20 |nd alloc|ate its |
|00001580| 64 61 74 61 20 61 72 65 | 61 20 2a 2f 0d 09 69 66 |data are|a */..if|
|00001590| 28 66 72 61 6d 65 2d 3e | 62 61 73 65 41 64 64 72 |(frame->|baseAddr|
|000015a0| 20 3d 3d 20 4e 55 4c 4c | 29 7b 0d 09 09 66 72 61 | == NULL|){...fra|
|000015b0| 6d 65 2d 3e 68 52 65 73 | 3d 66 72 61 6d 65 2d 3e |me->hRes|=frame->|
|000015c0| 76 52 65 73 3d 30 78 34 | 38 30 30 30 30 3b 09 2f |vRes=0x4|80000;./|
|000015d0| 2f 20 37 32 20 64 70 69 | 0d 09 09 66 72 61 6d 65 |/ 72 dpi|...frame|
|000015e0| 2d 3e 70 6d 56 65 72 73 | 69 6f 6e 3d 66 72 61 6d |->pmVers|ion=fram|
|000015f0| 65 2d 3e 70 61 63 6b 54 | 79 70 65 3d 66 72 61 6d |e->packT|ype=fram|
|00001600| 65 2d 3e 70 61 63 6b 53 | 69 7a 65 3d 30 3b 0d 09 |e->packS|ize=0;..|
|00001610| 09 66 72 61 6d 65 2d 3e | 70 6c 61 6e 65 42 79 74 |.frame->|planeByt|
|00001620| 65 73 3d 66 72 61 6d 65 | 2d 3e 70 6d 52 65 73 65 |es=frame|->pmRese|
|00001630| 72 76 65 64 3d 30 3b 0d | 09 09 66 72 61 6d 65 2d |rved=0;.|..frame-|
|00001640| 3e 63 6d 70 43 6f 75 6e | 74 3d 31 3b 0d 09 09 66 |>cmpCoun|t=1;...f|
|00001650| 72 61 6d 65 2d 3e 63 6d | 70 53 69 7a 65 3d 66 72 |rame->cm|pSize=fr|
|00001660| 61 6d 65 2d 3e 70 69 78 | 65 6c 53 69 7a 65 3b 0d |ame->pix|elSize;.|
|00001670| 09 09 66 72 61 6d 65 2d | 3e 70 6d 54 61 62 6c 65 |..frame-|>pmTable|
|00001680| 3d 28 2a 2a 28 2a 2a 47 | 65 74 47 44 65 76 69 63 |=(**(**G|etGDevic|
|00001690| 65 28 29 29 2e 67 64 50 | 4d 61 70 29 2e 70 6d 54 |e()).gdP|Map).pmT|
|000016a0| 61 62 6c 65 3b 0d 09 09 | 66 72 61 6d 65 2d 3e 72 |able;...|frame->r|
|000016b0| 6f 77 42 79 74 65 73 3d | 28 28 66 72 61 6d 65 2d |owBytes=|((frame-|
|000016c0| 3e 62 6f 75 6e 64 73 2e | 72 69 67 68 74 2d 66 72 |>bounds.|right-fr|
|000016d0| 61 6d 65 2d 3e 62 6f 75 | 6e 64 73 2e 6c 65 66 74 |ame->bou|nds.left|
|000016e0| 29 2a 66 72 61 6d 65 2d | 3e 70 69 78 65 6c 53 69 |)*frame-|>pixelSi|
|000016f0| 7a 65 20 2b 20 33 31 20 | 26 20 7e 33 31 29 2f 38 |ze + 31 |& ~31)/8|
|00001700| 3b 20 2f 2a 20 72 6f 75 | 6e 64 20 75 70 20 74 6f |; /* rou|nd up to|
|00001710| 20 6d 75 6c 74 69 70 6c | 65 20 6f 66 20 33 32 20 | multipl|e of 32 |
|00001720| 62 69 74 73 20 2a 2f 0d | 09 09 66 72 61 6d 65 42 |bits */.|..frameB|
|00001730| 79 74 65 73 3d 28 73 69 | 7a 65 5f 74 29 20 66 72 |ytes=(si|ze_t) fr|
|00001740| 61 6d 65 2d 3e 72 6f 77 | 42 79 74 65 73 20 2a 20 |ame->row|Bytes * |
|00001750| 28 66 72 61 6d 65 2d 3e | 62 6f 75 6e 64 73 2e 62 |(frame->|bounds.b|
|00001760| 6f 74 74 6f 6d 2d 66 72 | 61 6d 65 2d 3e 62 6f 75 |ottom-fr|ame->bou|
|00001770| 6e 64 73 2e 74 6f 70 29 | 3b 0d 09 09 66 72 61 6d |nds.top)|;...fram|
|00001780| 65 2d 3e 72 6f 77 42 79 | 74 65 73 20 7c 3d 20 30 |e->rowBy|tes |= 0|
|00001790| 78 38 30 30 30 3b 09 2f | 2a 20 4d 61 72 6b 20 69 |x8000;./|* Mark i|
|000017a0| 74 20 61 73 20 61 20 50 | 69 78 4d 61 70 20 2a 2f |t as a P|ixMap */|
|000017b0| 0d 09 09 66 72 61 6d 65 | 2d 3e 62 61 73 65 41 64 |...frame|->baseAd|
|000017c0| 64 72 3d 28 63 68 61 72 | 20 2a 29 20 4e 65 77 50 |dr=(char| *) NewP|
|000017d0| 74 72 28 66 72 61 6d 65 | 42 79 74 65 73 29 3b 0d |tr(frame|Bytes);.|
|000017e0| 09 09 69 66 28 66 72 61 | 6d 65 2d 3e 62 61 73 65 |..if(fra|me->base|
|000017f0| 41 64 64 72 20 3d 3d 20 | 4e 55 4c 4c 29 72 65 74 |Addr == |NULL)ret|
|00001800| 75 72 6e 20 31 3b 09 2f | 2a 20 65 72 72 6f 72 20 |urn 1;./|* error |
|00001810| 72 65 74 75 72 6e 20 2a | 2f 0d 09 7d 0d 09 69 66 |return *|/..}..if|
|00001820| 28 28 73 69 7a 65 5f 74 | 29 66 72 61 6d 65 2d 3e |((size_t|)frame->|
|00001830| 62 61 73 65 41 64 64 72 | 25 34 20 21 3d 20 30 4c |baseAddr|%4 != 0L|
|00001840| 29 7b 0d 09 09 70 72 69 | 6e 74 66 28 22 46 72 61 |){...pri|ntf("Fra|
|00001850| 6d 65 20 62 75 66 66 65 | 72 20 61 64 64 72 65 73 |me buffe|r addres|
|00001860| 73 20 69 73 20 6e 6f 74 | 20 6c 6f 6e 67 20 61 6c |s is not| long al|
|00001870| 69 67 6e 65 64 2e 5c 30 | 30 37 5c 6e 22 29 3b 0d |igned.\0|07\n");.|
|00001880| 09 7d 0d 0d 09 2f 2a 20 | 63 72 65 61 74 65 20 72 |.}.../* |create r|
|00001890| 61 6e 64 6f 6d 20 6e 6f | 69 73 65 20 2a 2f 0d 09 |andom no|ise */..|
|000018a0| 2f 2a 20 46 69 72 73 74 | 20 63 72 65 61 74 65 20 |/* First| create |
|000018b0| 61 20 72 61 6e 64 6f 6d | 20 62 69 74 20 69 6d 61 |a random| bit ima|
|000018c0| 67 65 2c 20 61 6c 6c 20 | 62 69 74 73 20 75 6e 63 |ge, all |bits unc|
|000018d0| 6f 72 72 65 6c 61 74 65 | 64 2e 20 2a 2f 0d 09 52 |orrelate|d. */..R|
|000018e0| 61 6e 64 46 69 6c 6c 28 | 62 75 66 66 65 72 2e 62 |andFill(|buffer.b|
|000018f0| 61 73 65 41 64 64 72 2c | 62 75 66 66 65 72 42 79 |aseAddr,|bufferBy|
|00001900| 74 65 73 29 3b 0d 09 2f | 2a 20 4e 6f 77 20 65 78 |tes);../|* Now ex|
|00001910| 70 61 6e 64 20 69 6d 61 | 67 65 20 73 6f 20 74 68 |pand ima|ge so th|
|00001920| 61 74 20 65 61 63 68 20 | 72 61 6e 64 6f 6d 20 62 |at each |random b|
|00001930| 69 74 20 62 65 63 6f 6d | 65 73 20 61 20 64 78 20 |it becom|es a dx |
|00001940| 62 79 20 64 79 20 72 65 | 63 74 61 6e 67 6c 65 2e |by dy re|ctangle.|
|00001950| 20 2a 2f 0d 09 52 47 42 | 42 61 63 6b 43 6f 6c 6f | */..RGB|BackColo|
|00001960| 72 28 26 77 68 69 74 65 | 52 47 42 29 3b 0d 09 52 |r(&white|RGB);..R|
|00001970| 47 42 46 6f 72 65 43 6f | 6c 6f 72 28 26 62 6c 61 |GBForeCo|lor(&bla|
|00001980| 63 6b 52 47 42 29 3b 0d | 09 43 6f 70 79 42 69 74 |ckRGB);.|.CopyBit|
|00001990| 73 28 26 62 75 66 66 65 | 72 2c 26 62 69 67 42 75 |s(&buffe|r,&bigBu|
|000019a0| 66 66 65 72 2c 26 62 75 | 66 66 65 72 2e 62 6f 75 |ffer,&bu|ffer.bou|
|000019b0| 6e 64 73 2c 26 62 69 67 | 42 75 66 66 65 72 2e 62 |nds,&big|Buffer.b|
|000019c0| 6f 75 6e 64 73 2c 73 72 | 63 43 6f 70 79 2c 4e 55 |ounds,sr|cCopy,NU|
|000019d0| 4c 4c 29 3b 0d 09 65 72 | 72 6f 72 3d 51 44 45 72 |LL);..er|ror=QDEr|
|000019e0| 72 6f 72 28 29 3b 0d 09 | 69 66 28 65 72 72 6f 72 |ror();..|if(error|
|000019f0| 29 70 72 69 6e 74 66 28 | 22 4d 61 6b 65 4e 6f 69 |)printf(|"MakeNoi|
|00001a00| 73 65 31 3a 61 3a 20 43 | 6f 70 79 42 69 74 73 20 |se1:a: C|opyBits |
|00001a10| 65 72 72 6f 72 20 25 64 | 5c 6e 22 2c 65 72 72 6f |error %d|\n",erro|
|00001a20| 72 29 3b 0d 09 2f 2a 20 | 46 69 6e 61 6c 6c 79 20 |r);../* |Finally |
|00001a30| 63 6f 70 79 20 69 74 20 | 69 6e 74 6f 20 74 68 65 |copy it |into the|
|00001a40| 20 66 72 61 6d 65 2c 20 | 74 72 69 6d 6d 69 6e 67 | frame, |trimming|
|00001a50| 20 69 74 20 64 6f 77 6e | 20 74 6f 20 74 68 65 20 | it down| to the |
|00001a60| 63 6f 72 72 65 63 74 20 | 73 69 7a 65 2e 20 2a 2f |correct |size. */|
|00001a70| 0d 09 52 47 42 42 61 63 | 6b 43 6f 6c 6f 72 28 26 |..RGBBac|kColor(&|
|00001a80| 62 61 63 6b 52 47 42 29 | 3b 0d 09 52 47 42 46 6f |backRGB)|;..RGBFo|
|00001a90| 72 65 43 6f 6c 6f 72 28 | 26 66 6f 72 65 52 47 42 |reColor(|&foreRGB|
|00001aa0| 29 3b 0d 09 73 72 63 52 | 65 63 74 3d 66 72 61 6d |);..srcR|ect=fram|
|00001ab0| 65 2d 3e 62 6f 75 6e 64 | 73 3b 0d 09 4f 66 66 73 |e->bound|s;..Offs|
|00001ac0| 65 74 52 65 63 74 28 26 | 73 72 63 52 65 63 74 2c |etRect(&|srcRect,|
|00001ad0| 2d 73 72 63 52 65 63 74 | 2e 6c 65 66 74 2c 2d 73 |-srcRect|.left,-s|
|00001ae0| 72 63 52 65 63 74 2e 74 | 6f 70 29 3b 0d 09 69 66 |rcRect.t|op);..if|
|00001af0| 28 72 61 6e 64 6f 6d 50 | 68 61 73 65 29 20 4f 66 |(randomP|hase) Of|
|00001b00| 66 73 65 74 52 65 63 74 | 28 26 73 72 63 52 65 63 |fsetRect|(&srcRec|
|00001b10| 74 2c 6e 72 61 6e 64 28 | 64 78 29 2c 6e 72 61 6e |t,nrand(|dx),nran|
|00001b20| 64 28 64 79 29 29 3b 0d | 09 65 6c 73 65 20 43 65 |d(dy));.|.else Ce|
|00001b30| 6e 74 65 72 52 65 63 74 | 49 6e 52 65 63 74 28 26 |nterRect|InRect(&|
|00001b40| 73 72 63 52 65 63 74 2c | 26 62 69 67 42 75 66 66 |srcRect,|&bigBuff|
|00001b50| 65 72 2e 62 6f 75 6e 64 | 73 29 3b 0d 09 43 6f 70 |er.bound|s);..Cop|
|00001b60| 79 42 69 74 73 28 26 62 | 69 67 42 75 66 66 65 72 |yBits(&b|igBuffer|
|00001b70| 2c 28 42 69 74 4d 61 70 | 20 2a 29 66 72 61 6d 65 |,(BitMap| *)frame|
|00001b80| 2c 26 73 72 63 52 65 63 | 74 2c 26 66 72 61 6d 65 |,&srcRec|t,&frame|
|00001b90| 2d 3e 62 6f 75 6e 64 73 | 2c 73 72 63 43 6f 70 79 |->bounds|,srcCopy|
|00001ba0| 2c 4e 55 4c 4c 29 3b 0d | 09 65 72 72 6f 72 3d 51 |,NULL);.|.error=Q|
|00001bb0| 44 45 72 72 6f 72 28 29 | 3b 0d 09 69 66 28 65 72 |DError()|;..if(er|
|00001bc0| 72 6f 72 29 70 72 69 6e | 74 66 28 22 4d 61 6b 65 |ror)prin|tf("Make|
|00001bd0| 4e 6f 69 73 65 31 3a 62 | 3a 20 43 6f 70 79 42 69 |Noise1:b|: CopyBi|
|00001be0| 74 73 20 65 72 72 6f 72 | 20 25 64 5c 6e 22 2c 65 |ts error| %d\n",e|
|00001bf0| 72 72 6f 72 29 3b 0d 09 | 44 69 73 70 6f 73 50 74 |rror);..|DisposPt|
|00001c00| 72 28 28 76 6f 69 64 20 | 2a 29 20 62 75 66 66 65 |r((void |*) buffe|
|00001c10| 72 2e 62 61 73 65 41 64 | 64 72 29 3b 0d 09 44 69 |r.baseAd|dr);..Di|
|00001c20| 73 70 6f 73 50 74 72 28 | 28 76 6f 69 64 20 2a 29 |sposPtr(|(void *)|
|00001c30| 20 62 69 67 42 75 66 66 | 65 72 2e 62 61 73 65 41 | bigBuff|er.baseA|
|00001c40| 64 64 72 29 3b 0d 09 72 | 65 74 75 72 6e 20 30 3b |ddr);..r|eturn 0;|
|00001c50| 0d 7d 0d 0d 0d 00 00 00 | 00 00 00 00 00 00 00 00 |.}......|........|
|00001c60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c80| 00 00 01 00 00 00 02 62 | 00 00 01 62 00 00 00 46 |.......b|...b...F|
|00001c90| ea a7 0b b5 fa ff 00 00 | 00 44 01 54 45 58 54 4b |........|.D.TEXTK|
|00001ca0| 41 48 4c 00 00 00 00 00 | 00 00 00 00 00 a7 00 00 |AHL.....|........|
|00001cb0| 0b 4d 61 6b 65 4e 6f 69 | 73 65 2e 63 02 00 00 00 |.MakeNoi|se.c....|
|00001cc0| 54 45 58 54 4b 41 48 4c | 00 00 00 00 00 00 00 00 |TEXTKAHL|........|
|00001cd0| 00 00 54 45 58 54 4b 41 | 48 4c 00 00 00 00 00 00 |..TEXTKA|HL......|
|00001ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cf0| 00 00 a7 e5 d5 bf 00 00 | 00 00 00 00 02 a8 00 2c |........|.......,|
|00001d00| c9 a7 0b d6 67 ff 00 00 | 00 46 fe 41 50 50 4c d7 |....g...|.F.APPL.|
|00001d10| 4c 53 44 00 00 00 00 00 | 00 00 00 00 00 04 00 ff |LSD.....|........|
|00001d20| ff ff ff ff ff ff ff 00 | 02 00 05 a7 0b d4 f7 00 |........|........|
|00001d30| 00 00 1e ff ff 00 00 47 | 4f a7 0b b8 35 ff 00 00 |.......G|O...5...|
|00001d40| 00 47 74 54 45 58 54 4b | 41 48 4c 00 00 00 00 00 |.GtTEXTK|AHL.....|
|00001d50| 00 00 00 00 00 a7 00 00 | 08 ff ff ff ff ff ff ff |........|........|
|00001d60| ff 00 11 a7 0b d4 f7 00 | 00 00 27 ff ff 00 00 44 |........|..'....D|
|00001d70| c2 a7 0b c8 c2 ff 00 00 | 00 44 c9 54 45 58 54 4b |........|.D.TEXTK|
|00001d80| 00 00 00 0a 00 00 0e ed | 00 4a 00 00 00 00 00 00 |........|.J......|
|00001d90| 01 50 00 0b 00 2c 00 00 | 11 37 00 62 00 cb 54 60 |.P...,..|.7.b..T`|
|00001da0| 80 00 00 29 03 c9 00 90 | 04 6f 94 20 00 00 00 00 |...)....|.o. ....|
|00001db0| 00 00 0d 62 75 66 66 65 | 72 2e 62 6f 75 6e 64 73 |...buffe|r.bounds|
|00001dc0| 00 1e 00 00 11 ca 00 64 | 00 cb 53 e8 00 00 0f 62 |.......d|..S....b|
|00001dd0| 75 66 66 65 72 2e 72 6f | 77 42 79 74 65 73 00 1a |uffer.ro|wBytes..|
|00001de0| 00 00 12 25 00 65 00 cb | 53 d8 00 00 0b 62 75 66 |...%.e..|S....buf|
|00001df0| 66 65 72 42 79 74 65 73 | 00 30 00 00 13 1f 00 6b |ferBytes|.0.....k|
|00001e00| 00 cb 53 c8 80 00 00 80 | 03 c2 00 e7 04 64 94 20 |..S.....|.....d. |
|00001e10| 00 00 00 00 00 00 11 62 | 69 67 42 75 66 66 65 72 |.......b|igBuffer|
|00001e20| 2e 62 6f 75 6e 64 73 20 | 00 22 00 00 13 93 00 6d |.bounds |.".....m|
|00001e30| 00 cb 53 5c 00 00 13 62 | 69 67 42 75 66 66 65 72 |..S\...b|igBuffer|
|00001e40| 2e 72 6f 77 42 79 74 65 | 73 20 00 16 00 00 15 2b |.rowByte|s .....+|
|00001e50| 00 75 00 cb 53 4c 00 00 | 07 2a 66 72 61 6d 65 20 |.u..SL..|.*frame |
|00001e60| 00 14 00 00 15 2b 00 75 | 00 cb 52 a8 00 00 05 66 |.....+.u|..R....f|
|00001e70| 72 61 6d 65 00 1a 00 00 | 15 2b 00 75 00 cb 52 98 |rame....|.+.u..R.|
|00001e80| 00 00 0b 66 72 61 6d 65 | 2d 3e 68 52 65 73 00 1a |...frame|->hRes..|
|00001e90| 00 00 16 a8 00 7c 00 cb | 52 88 00 00 0b 66 72 61 |.....|..|R....fra|
|00001ea0| 6d 65 42 79 74 65 73 20 | 00 26 00 00 15 0d 00 74 |meBytes |.&.....t|
|00001eb0| 00 cb 51 3c 80 00 00 ca | 03 c9 01 9f 04 b7 94 20 |..Q<....|....... |
|00001ec0| 00 00 00 00 00 00 07 2a | 66 72 61 6d 65 20 00 14 |.......*|frame ..|
|00001ed0| 00 00 15 0d 00 74 00 cb | 50 cc 00 00 05 66 72 61 |.....t..|P....fra|
|00001ee0| 6d 65 00 00 01 00 00 00 | 02 62 00 00 01 62 00 00 |me......|.b...b..|
|00001ef0| 00 46 00 55 f5 18 15 ac | 00 00 00 1c 00 46 00 01 |.F.U....|.....F..|
|00001f00| 42 4b 50 54 00 00 00 12 | 44 54 56 55 00 00 00 1e |BKPT....|DTVU....|
|00001f10| 3c 9c ff ff 00 00 00 00 | 00 00 00 00 3f 7c ff ff |<.......|....?|..|
|00001f20| 00 00 00 0e 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+